import { createRouter, createWebHistory } from 'vue-router';
import LoginView from '@/views/LoginView.vue';
import RegisterView from '@/views/RegisterView.vue';
import FriendsView from '@/views/FriendsView.vue';
import AddFriendView from '@/views/AddFriendView.vue';
import MessagesView from '@/views/MessagesView.vue';
import ProfileView from '@/views/ProfileView.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: LoginView
    },
    {
      path: '/register',
      component: RegisterView
    },
    {
      path: '/friends',
      component: FriendsView
    },
    {
      path: '/add-friend',
      component: AddFriendView
    },
    {
      path: '/chat/:friendId',
      component: () => import('@/views/ChatView.vue')
    },
    {
      path: '/messages',
      component: MessagesView
    },
    {
      path: '/profile',
      component: ProfileView
    },
    {
      path: '/group-chat',
      component: () => import('@/views/GroupChatView.vue')
    },
    {
      path: '/',
      redirect: '/messages'
    }
  ]
});

export default router; 